#include "obstacle.h"
#include <QPixmap>

Obstacle::Obstacle(const QString& imgPath, QGraphicsItem* parent)
    :   // 显式初始化QObject
    QGraphicsPixmapItem(parent)
{
    QPixmap pixmap(imgPath);
    if (pixmap.isNull()) {
        qFatal("Failed to load obstacle image: %s", qUtf8Printable(imgPath));
    }
    setPixmap(pixmap);
}
